@extends('layouts.default')

@section('title')
    {{{ $user->name }}} {{ lang('Charge Point') }}_@parent
@stop

@section('content')

    <div class="users-show row">

        <div class="col-md-3">
            @include('users.partials.basicinfo')
        </div>

        <div class="main-col col-md-9 left-col">

            <ol class="breadcrumb">
                <li><a href="{{ route('users.show', $user->id) }}">个人中心</a></li>
                <li class="active">积分明细</li>
            </ol>

            <div class="panel panel-default text-center">
                <div class="panel-body">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th class="text-center">剩余积分数</th>
                            <th class="text-center">变更积分数</th>
                            <th class="text-center">变更类型</th>
                            <th class="text-center">变更原因</th>
                            <th class="text-center">变更时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($user_point_list  as $point_item)
                        <tr>
                            <td>{{$point_item['remain_points']}}</td>
                            <td>{{$point_item['points']}}</td>
                            @if($point_item['type'] == 1)
                                <td>增加</td>
                            @elseif($point_item['type'] == 2)
                                <td>消耗</td>
                            @endif
                            @if($point_item['reason_type'] == UserPointsLog::REASON_TYPE_SIGN)
                                <td>签到</td>
                            @elseif($point_item['reason_type'] == UserPointsLog::REASON_TYPE_DB2POINTS)
                                <td>D币转换积分</td>
                            @elseif($point_item['reason_type'] == UserPointsLog::REASON_TYPE_RESOURCE_DOWNLOADED)
                                <td>资源被下载</td>
                            @elseif($point_item['reason_type'] == UserPointsLog::REASON_TYPE_DOWNLOAD_RESOURCE)
                                <td>下载资源</td>
                            @elseif($point_item['reason_type'] == UserPointsLog::REASON_TYPE_MANMODIFIED)
                                <td>人为修改</td>
                            @endif
                            <td>{{$point_item['updated_at']}} </td>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>

                </div>
                <div class="panel-footer text-right remove-padding-horizontal pager-footer">
                    <!-- Pager -->
                    {!! $user_point_list->appends(Request::except('page', '_pjax'))->render() !!}
                </div>

            </div>
        </div>
    </div>

@stop
